package com.springboot.study.listener;

import org.springframework.boot.context.event.ApplicationStartedEvent;
import org.springframework.boot.context.event.SpringApplicationEvent;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @Author: guodong
 * @Date: 2021/5/13 10:21
 * @Version: 1.0
 * @Description:
 */
@Component
public class MyApplicationListener implements ApplicationListener<SpringApplicationEvent>  {

    @Override
    public void onApplicationEvent(SpringApplicationEvent event) {
//        System.out.println("事件触发："+event.getClass().getName());
    }


//    @Override
//    public void onApplicationEvent(ApplicationStartedEvent event) {
//        System.out.println("事件触发："+event.getClass().getName());
//    }

}
